package com.huahua.myIdea.service.serviceImpl;

import com.huahua.myIdea.dao.IGoodsDao;
import com.huahua.myIdea.entity.GoodsDo;
import com.huahua.myIdea.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private IGoodsDao goodsDao;

    @Override
    public void add(GoodsDo goods) {
        goodsDao.save(goods);
    }

    @Override
    public void remove(Long id) {
        goodsDao.deleteById(id);
    }

    @Override
    public void edit(GoodsDo goods) {
        goodsDao.save(goods);
    }

    @Override
    public Optional<GoodsDo> getById(Long id) {
        return Optional.empty();
    }

    @Override
    public Iterable<GoodsDo> getList() {
        return null;
    }
}
